package city.spring.modules.material.repository;

import city.spring.modules.material.entity.MaterialBreakageDeliveryMaterialEntity;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 存储库：报损出库关联物资表
 *
 * @author 谢金婷
 * @date 2021-01-20 10:53:12
 */
@Repository
public interface MaterialBreakageDeliveryMaterialRepository extends BaseMapper<MaterialBreakageDeliveryMaterialEntity> {
    /**
     * 获取入库的物资列表
     *
     * @param wrapper 查询对象
     * @return
     */
    List<MaterialBreakageDeliveryMaterialEntity> getMaterials(@Param(Constants.WRAPPER) Wrapper<? extends MaterialBreakageDeliveryMaterialEntity> wrapper);

    /**
     * 获取入库的物资列表
     *
     * @param breakageId 入库单ID
     * @return
     */
    List<MaterialBreakageDeliveryMaterialEntity> getDeliveryMaterials(String breakageId);

    /**
     * 获取入库的某个物资
     *
     * @param breakageId 入库ID
     * @param extId      主键ID
     * @return
     */
    MaterialBreakageDeliveryMaterialEntity getDeliveryMaterial(String breakageId, String extId);
}